#@layout()

#define content()

<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:true">
        <div id="datagridId"></div>

        <div id="datagridTb">
            <div class="row">
                <div class="col-md-12">
                    <form id="searchForm">
                        <div class="easyui-panel" title="信息查询" style="width:100%;padding:10px;"
                             data-options="iconCls:'icon-application_form'">

                            开始时间: <input class="easyui-datebox" id="startDate" data-options="required:true,editable:false"
                                         style="width:200px">&nbsp;&nbsp;
                            结束时间: <input class="easyui-datebox" id="endDate" data-options="required:true,editable:false"
                                         style="width:200px">&nbsp;&nbsp;
                            <a href="javascript:;" class="easyui-linkbutton" data-options="plain:true"
                               onclick="datagridQuery();" iconCls="icon-zoom">#(_res.get('system.common.search'))</a>
                            <a href="javascript:;" class="easyui-linkbutton" data-options="plain:true"
                               onclick="$('#searchForm').form('clear');" iconCls="icon-zoom_out">#(_res.get('system.common.clear'))</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</div>

#end


#define css()

#end


#define js()

<script type="text/javascript">

    var _datagrid = "datagridId", _form = "formId", _datagridTb = "datagridTb";
    var datagridListUrl = contextRootPath + '/dataStatistics/phoneUseList';

    $(function () {
        //初始化表格
        $("#" + _datagrid).datagrid({
            url: datagridListUrl,
            fit: true,
            border: false,
            rownumbers: true,
            pageSize: 20,
            toolbar: '#' + _datagridTb,
            singleSelect: false,
            pagination: true,
            nowrap: false,
            striped: true,
            fitColumns: true,
            columns: [[
                {
                    field: DBConts.TABLE_DATA_STATISTICS.DEVICE_TYPE,
                    title: "手机厂商",
                    sortable: true
                },
                {
                    field: DBConts.TABLE_DATA_STATISTICS.DEVICE_NAME,
                    title: "手机型号",
                    sortable: true
                },
                {
                    field: 'use_count',
                    title: "使用数量",
                    sortable: true
                }
            ]]
        });
    });


    function datagridQuery() {
        var flag = $("#searchForm").form('enableValidation').form('validate');

        if (!flag) return;

        $("#" + _datagrid).datagrid({
            queryParams: {
                'tenantId': $('#tenantId').val(),
                'startDate': $('#startDate').val(),
                'endDate': $('#endDate').val()
            }
        });
    }
</script>

#end



